  
<include file="Public/header" />
   <link rel="stylesheet" href="__ROOT__/public/home/css/per-rec-comp.css">
    <section class="per-box">
        <div class="center-element clear">
            <!-- 左边 -->
   <!--           <include file="Public/UserMenu" />     -->
            <!-- 右边 -->
            <article class="per-cont">
                <div class="title">
                    <span>充值</span>
                </div>
                <div class="cont-rec-comp">
                   <div>
                       <img src="{:U('User/WeiXinPayCode',$order)}" alt="">
                   </div>
                   <p>本次支付{$order['total_fee']/100}元</p>
                    <input type="hidden" name="out_trade_no" value="{$order['out_trade_no']}">
                    <input type="hidden" name="user_id" value="{$order['user_id']}">
                   <p>微信扫描，完成支付</p>
                   <h4 id="tips" style="color: red"></h4>
                </div>

            </article>
        </div>

    </section>
        <include file="Public/footer" />
<script type="text/javascript">

    $(function(){
        var out_trade_no=$("input[name='out_trade_no']").val();
        var user_id=$("input[name='user_id']").val();
    function show(){
      
       $.ajax({
            type:'post',
            url:"{:U('WeixinPay/checkpay')}",
            data:{out_trade_no:out_trade_no},
            dataType:'json',
            success:function(msg){
                if(msg=='success'){                     
                    $("#tips").html("支付成功！<a href='/index.php/User/MyMoney.html'> 返回</a>");

                }
            }
       });
    };
    setInterval(show,3000);// 注意函数名没有引号和括弧！ 
})
</script>
